Wiki

Clone wiki

codetrainer / Unit Testing

Unit Testing

For doing the unit tests Google Test framework is to be used.

Google Test

The Google Test can be found at https://code.google.com/p/googletest/downloads/list (version 1.7.0 was tested) . You should put the extracted contents alongside your Code Trainer frameworks, to have an example hierarchy like this:

#!c++
-- C:\Code
----- CodeTrainer
----- CodeTrainerPlugins
----- gtest

The C:\Code\gtest folder should contain something like this:

#!python

test
build-aux
src
cmake
scripts
codegear
samples
msvc
make
fused-src
include
m4
xcode
CONTRIBUTORS
Makefile.am
Makefile.in
configure.ac
README
configure
CMakeLists.txt
CHANGES
aclocal.m4
LICENSE

After this, you should launch buildall.bat (or buildall.sh) and it should detect automatically that you have available the Google Test framework. This will result in building the currently minimal unit tests.

After building, you should go into install directory and you will find an executable "unit_test.exe". You can launch this and see the unit tests execute.

Updated